package org.andcool.animation.ease;

/**
 * @author Joosun
 * @since 2011-5-8
 */
public class EaseSine extends BaseEase
{
	public EaseSine(final EasingMode pEasingMode)
	{
		super(pEasingMode);
	}

	@Override
	protected float getEaseInInterpolation(final float pPercentage)
	{
		return (float) (-Math.cos(pPercentage * (Math.PI / 2)) + 1);
	}

	@Override
	protected float getEaseOutInterpolation(final float pPercentage)
	{
		return (float) Math.sin(pPercentage * (Math.PI / 2));
	}

	@Override
	protected float getEaseInOutInterpolation(final float pPercentage)
	{
		return (float) (-0.5f * (Math.cos(Math.PI * pPercentage) - 1));
	}
}